<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('candidate')} > ${i18n.getMessage('create_one')}">
</@showTitle>

<div id="error" style="display:none"></div>


<form action="englishtest/addCandidate.sgt" validator="englishtest/validateCandidate.sgt" onsubmit="submitFormValidation(this); return false;" onreset="$('error').hide()">
	<table id="dataTable" align="center" cellspacing="5" cellpadding="0"><tr>
		<td class="name"><@required/>${i18n.getMessage('student.code')}:</td>
		<td><input type="text" name="candidateCode" class="w200" /></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('firstName')}:</td>
		<td><input type="text" name="firstName" class="w200" /></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('lastName')}:</td>
		<td><input type="text" name="lastName" class="w200" /></td>
	</tr><tr>
		<td class="name">${i18n.getMessage('nickName')}:</td>
		<td><input type="text" name="nickName" class="w200" /></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('gender')}:</td>
		<td>
			<input type="radio" name="gender" value="MALE" /> ${i18n.getMessage('gender.male')}
			<input type="radio" name="gender" value="FEMALE" /> ${i18n.getMessage('gender.female')}
		</td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('dateOfBirth')}:</td>
		<td><input type="text" name="dateOfBirth" class="w200" /><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].dateOfBirth, '${i18n.getMessage('format.date')}', this)"/></td>
	</tr><tr>
		<td class="name">${i18n.getMessage('address')}:</td>
		<td><input type="text" name="address" class="w200" /></td>
	</tr><tr>
		<td class="name">${i18n.getMessage('email')}:</td>
		<td><input type="text" name="email" class="w200" /></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('phoneNumber')}:</td>
		<td><input type="text" name="phoneNumber" class="w200" /></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('type')}:</td>
		<td><select name="typeId" class="w200">
			<#list types as type>
				<option value="${(type.id)!}" <#if type.name="Normal">selected</#if>>${(type.name)!}</option>
			</#list>
		</select></td>
	</tr><tr>
		<td class="name"><@required/>Registered Date:</td>
		<td><input type="text" name="registeredDate" value="${now?date}" class="w200"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].consultedDate, '${i18n.getMessage('format.date')}', this)"/></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('Consultant')}:</td>
		<td><select name="consultantId" class="w200">
			<option></option>
				<#list consultants as consultant>
					<option value="${(consultant.id)!}" <#if action.USER().id == consultant.id>selected</#if>>${(consultant.fullName)!}</option>
				</#list>
		</select></td>
	</tr><tr>
		<td class="name" style="vertical-align:top">${i18n.getMessage('comment')}:</td>
		<td><textarea name="comment" class="w350 h075"></textarea></td>
	</tr><tr>
		<td class="name"></td>
		<td>
			<input type="submit" value="${i18n.getMessage('add')}" class="button_style"/> 
			<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
		</td>
	</tr></table>
</form>

<script>
$('error').hide();
showHideInfo = function(selector) {
	if (selector.value == "") {
		$("pop").style.display = "none"
	}
	else { $("pop").style.display = "" }
}
</script>